package monopoly.ui;

import monopoly.Railroad;
import monopoly.Utility;
import monopoly.StreetProperty;
import monopoly.Tax;


public class GameBoardSpace {

	private String boardFileName;
	private String cardFileName;
	private int xPosition;
	private int yPosition;
	private String description;
	private Railroad railroad;
	private Utility utility;
	private StreetProperty streetProperty;
	private Tax tax;
	private String cardType;


	
	public GameBoardSpace()
	{
		boardFileName = "";
		cardFileName = "";
		xPosition = 0;
		yPosition = 0;
		description = "";
		railroad = null;
		utility = null;
		streetProperty = null;
		tax = null;
		cardType = null;
	}
	
	public GameBoardSpace(String bf, String cf, int x, int y, String d)
	{
		boardFileName = bf;
		cardFileName = cf;
		xPosition = x;
		yPosition = y;
		description = d;
		railroad = null;
		utility = null;
		streetProperty = null;
		tax = null;
		cardType = null;
		
	}
	
	public boolean isProperty()
	{
		if (railroad != null) return true;
		if (utility != null) return true;
		if (streetProperty != null) return true;
		return false;
	}
	
	public String getType()
	{
		if (railroad != null) return "Railroad";
		if (utility != null) return "Utility";
		if (streetProperty != null) return "Street Property";
		if (tax != null) return "Tax";
		if (cardType != null) return cardType;
		
		return description;	
	}
	
	public String getBoardSpaceFN()
	{
		return boardFileName;
	}
	
	public String getCardFN()
	{
		return cardFileName;
	}
	
	public int getXPosition()
	{
		return xPosition;
	}
	
	public int getYPosition()
	{
		return yPosition;
	}
	
	public int getXTokenPosition()
	{
		if (description.equals("In Jail"))
			return xPosition + 30;
		else if (description.equals("Just Visiting"))
			return xPosition;
		else
			return xPosition + 10;
	}
	
	public int getYTokenPosition()
	{
		if (description.equals("In Jail"))
			return yPosition + 5;
		else if (description.equals("Just Visiting"))
			return yPosition + 35;
		else
			return yPosition + 10;
	}
	
	public String getDescription()
	{
		return description;
	}
	
	public void setRailroad(Railroad railroad)
	{
		this.railroad = railroad;
	}
	
	public Railroad getRailroad()
	{
		return this.railroad;
	}
	
	public void setUtility(Utility utility)
	{
		this.utility = utility;
	}
	
	public Utility getUtility()
	{
		return this.utility;
	}
	
	public void setStreetProperty(StreetProperty streetProperty)
	{
		this.streetProperty = streetProperty;
	}
	
	public StreetProperty getStreetProperty()
	{
		return this.streetProperty;
	}
	
	public void setTax(Tax tax)
	{
		this.tax = tax;
	}
	
	public Tax getTax()
	{
		return this.tax;
	}
	
	public void setCard(String cardType)
	{
		this.cardType = cardType;
	}
	
	public String getCardType()
	{
		return this.cardType;
	}
	
	public boolean isCard()
	{
		if (this.cardType != null) return true;
		return false;
	}
}

